<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>登陆页面</title>

<meta http-equiv=Content-Type CONTENT="text/html; charset=gbk" />
<title>Login</title>
<link href="<%=basePath %>css/blue/login.css" type=text/css rel=stylesheet />
<script type="text/javascript">
function checkLogin(){
	var loginName=document.getElementById("loginName");
	var loginPwd =document.getElementById("loginPwd");
	var checkCode=document.getElementById("checkCode");
	console.log(loginName+"==="+loginPwd+"==="+checkCode);
	if(loginName.value==""){
		alert('登陆名不能为空');
		return false;
	}else if(loginPwd.value==""){
		alert('登陆密码不能为空');
		return false;
	}else if(checkCode.value==""){
		alert('验证码不能为空');
		return false;
	}else{
		document.form.submit();
		return true;
	}
}
	function refresh(obj) {
		obj.src = "<%=basePath%>servlet/ImageServlet?" + Math.random();
	}
</script>
</head>
<body LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0
	CLASS=PageBody>
	<form method="post"  onsubmit="return checkLogin()"
		action="${pageContext.request.contextPath }/servlet/ManagerLoginServlet">
		<div ID="CenterAreaBg">
			<div ID="CenterArea">
				<div ID="LogoImg"">
					<span
						style="font-size: 23px;width: 400px;margin-bottom:30px;color: white;text-shadow: 2px 2px 2px black;"
						class="logo_title headtext"> <strong>后台登陆</strong></span>
				</div>
				<div ID="LoginInfo">
					<table BORDER=0 CELLSPACING=0 CELLPADDING=0 width=100%>
						<tr>
							<td width=45 CLASS="Subject"><IMG BORDER="0"
								SRC="<%=basePath %>images/userId.gif" /></td>
							<td><input SIZE="20" CLASS="TextField" TYPE="text"
								NAME="userName" id="loginName" /></td>
							<td ROWSPAN="2" STYLE="padding-left:10px;"><input
								TYPE="image" SRC="<%=basePath %>images/userLogin_button.gif"
								onclick="checkLogin();" /></td>
						</tr>
						<tr>
							<td CLASS="Subject"><img BORDER="0"
								SRC="<%=basePath %>images/password.gif" /></td>
							<td><input SIZE="20" CLASS="TextField" TYPE="password"
								NAME="password" id="loginPwd" /></td>
						</tr>
						<tr>
							<td><font CLASS="Subject"
								style="color:#BEDBEE;font-size: 13px;">身&nbsp;&nbsp;份</font></td>
							<td><select name="loginId">
									<option>普通管理员</option>
									<option>超级管理员</option>
							</select></td>

						</tr>
						<tr>
							<td><font CLASS="Subject"
								style="color:#BEDBEE;font-size: 13px;">验证码</font></td>
							<td><input type="text" id="checkCode" CLASS="TextField"
								name="randomCode" /></td> &nbsp;&nbsp;&nbsp;
							<td><img title="点击更换" onclick="javascript:refresh(this);"
								src="<%=basePath%>servlet/ImageServlet"></td>
						</tr>
					</table>
				</div>

				<div ID="CopyRight">
					<a HREF="javascript:void(0)">Copyright &copy; 2014.西安工业大学</a>
				</div>
			</div>
		</div>
	</form>
</body>

</html>
